package com.sedshop.shop.library.fresco;/**
 * Created by Administrator on 2016/4/15.
 */

import android.app.Activity;
import android.net.Uri;

import com.facebook.drawee.view.SimpleDraweeView;

/**
 * 作者：Administrator on 2016/4/15 11:07
 * 邮箱：314960314@qq.com
 */
public class FrescoUtils {
    /**
     * xml域名空间换成  xmlns:fresco="http://schemas.android.com/apk/res-auto"
     * xml使用  com.facebook.drawee.view.SimpleDraweeView  作为控件
     * 调用的地方 setContentView 前面需要初始化 Fresco.initialize(this);
     * @param activity
     * @param id
     * @param url
     */
    public static void displayImage(Activity activity,int id,String url){
        SimpleDraweeView simpleDraweeView = (SimpleDraweeView)activity.findViewById(id);
        Uri imageUri = Uri.parse(url);
        simpleDraweeView.setImageURI(imageUri);
    }
}
